﻿using System.Text;

namespace Framework
{
    public static class StringBuilderExtension
    {
        /// <summary>
        /// 将StringBuilder中的以s结尾的字符串去掉
        /// </summary>
        /// <param name="sb"></param>
        /// <param name="s"></param>
        public static void TrimEndStringBuilder(this StringBuilder sb, string s)
        {
            if (sb.Length > 0)
                sb.Replace(s, "", sb.Length - s.Length, s.Length);
        }

        public static void Clear(this StringBuilder sb)
        {
            sb.Remove(0, sb.Length);
        }

    }
}
